Convince OS X to fully fullscreen windows
authorMatthias Clasen <mclasen@redhat.com>
Tue, 28 Feb 2017 23:44:33 +0000 (18:44 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 2 Mar 2017 13:10:39 +0000 (08:10 -0500)
We typically want to have the full screen given to
the content, not the aspect-ratio preserving behavior
that newer OS X has.

https://bugzilla.gnome.org/show_bug.cgi?id=779383

gdk/quartz/GdkQuartzNSWindow.c
gdk/quartz/GdkQuartzNSWindow.h

index cafabf452281b47ab091e751c425aa96babc3a4e..d85056be85385abb844dc57d2deae188c1ade8d2 100644 (file)
@@ -838,4 +838,19 @@ update_context_from_dragging_info (id <NSDraggingInfo> sender)
   inMaximizeTransition = NO;
 }
 
+-(NSSize)window:(NSWindow *)window willUseFullScreenContentSize:(NSSize)proposedSize
+{
+  return [[window screen] frame].size;
+}
+
+-(void)windowWillEnterFullScreen:(NSNotification *)aNotification
+{
+  lastUnfullscreenFrame = [self frame];
+}
+
+-(void)windowWillExitFullScreen:(NSNotification *)aNotification
+{
+  [self setFrame:lastUnfullscreenFrame display:YES]
+}
+
 @end
index 31175da25516713384dba8574d3302e904a84d79..b8edf43e697e3ac291f8442b8bcfa5e2a48ae247 100644 (file)
@@ -37,6 +37,7 @@
 
   NSRect  lastUnmaximizedFrame;
   NSRect  lastMaximizedFrame;
+  NSRect  lastUnfullscreenFrame;
   BOOL    inMaximizeTransition;
 }